#include "serial.h"

// 重定向c库函数printf到huart1
int fputc(int ch, FILE *f) {
	HAL_UART_Transmit(&huart1, (uint8_t *)&ch, 1, 0xFFFF);  //串口printf发送开关
    return ch;
}
int fgetc(FILE *f)
{
  uint8_t ch = 0;
  HAL_UARTEx_ReceiveToIdle_DMA(&huart1, &ch, 1);
  return ch;
}

